﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site2.Master" AutoEventWireup="true" CodeBehind="SchoolEditBySchoolAccount.aspx.cs" Inherits="WebApplication1.SchoolEditBySchoolAccount" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            //为了不至于和页面上其他元素混乱，所以把TreeView控件放在一个id为Treeview的div中，然后
            //再查找checkbox
            $("#Treeview table tr td  input[type=checkbox]").click(
             function () {

                 $("#Treeview div[id=" + $(this).attr("id").toString().replace(/CheckBox/, "Nodes") + "] table tr td  input[type=checkbox]")
                    .attr("checked", $(this).attr("checked"));
             }
            );
        });
    </script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>
        SchoolsEdit
    </h2>
    <p>
        SchoolInfo</p>
    <asp:Panel ID="Panel1" runat="server">
        <div style="width:491px; height:340px;border:1px solid gray;z-index: 1;" 
        id="container"></div>
<script type="text/javascript">
    var map = new BMap.Map("container");

    var pt = new BMap.Point("<%=strJ %>", "<%=strW %>");
    map.centerAndZoom(pt, 15);
    map.addControl(new BMap.NavigationControl());
    map.enableScrollWheelZoom();

    function aasearch() {
        var local = new BMap.LocalSearch(map, {
            renderOptions: { map: map }
        });
        local.search(document.getElementById('MainContent_tbxInputSearch').value);
    };

    var gc = new BMap.Geocoder();

    map.addEventListener("click", function (e) {
        var pt = e.point;
        gc.getLocation(pt, function (rs) {
            var addComp = rs.addressComponents;
            document.getElementById('MainContent_tbxLongitude').value = pt.lng;
            document.getElementById('MainContent_tbxLatitude').value = pt.lat;
            document.getElementById('MainContent_tbxAddress').value = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
        });
    });
    //    search();
</script>


        <asp:TextBox ID="tbxInputSearch" runat="server" 
        
        style=" z-index: 1;  height: 25px"></asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" Text="搜索" 
        style="z-index: 1; left: 851px; top: 281px; " />

    <asp:TextBox ID="tbxLongitude" runat="server" 
        
        style="  height: 33px; width: 202px"></asp:TextBox>
    <asp:TextBox ID="tbxLatitude" runat="server" 
        
        style=" height: 34px; width: 200px; z-index: 1; margin-top: 13px"></asp:TextBox>
    <p style="width: 428px">
        <asp:TextBox ID="tbxAddress" runat="server" 
            style=" width: 198px; height: 81px; z-index: 1; margin-top: 0px" 
            TextMode="MultiLine"></asp:TextBox>
    </p>

    <script type="text/javascript">
        document.getElementById('MainContent_btnSearch').onclick = function () {
            aasearch();
            return false;
        };
    </script>
    </asp:Panel>

    <p>
    </p>
    <p>
    </p>
    <p>
        Name</p>
    <p>
        <asp:TextBox ID="tbxName" runat="server"></asp:TextBox>
    </p>
    <p>
        Type</p>
    <p>
        <asp:DropDownList ID="ddlType" runat="server">
            <asp:ListItem Selected="True">学校</asp:ListItem>
            <asp:ListItem>机构</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        BriefIntroduction&nbsp;</p>
    <p>
        <asp:TextBox ID="tbxBriefIntroduction" runat="server" Height="124px" 
            TextMode="MultiLine" Width="839px"></asp:TextBox>
    </p>
    <p>
        Phone</p>
    <p>
        <asp:TextBox ID="tbxPhone" runat="server" MaxLength="20"></asp:TextBox>
    </p>

    <asp:Panel ID="Panel2" runat="server">
        <p>
            Tag<asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
        </p>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
            <ContentTemplate>
                <asp:TreeView ID="tvTag" runat="server" EnableClientScript="true" 
                OnClick="TreeViewCheckBox_Click(event)" 
                ontreenodecheckchanged="tvTag_TreeNodeCheckChanged1" ShowCheckBoxes="All">
                </asp:TreeView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>

    <script type="text/javascript" language="javascript">
        function TreeViewCheckBox_Click(event) {
            o = (window.event) ? window.event.srcElement : event.target;
            if (o.tagName == "INPUT" && o.type == "checkbox") {
                __doPostBack("MainContent_tvTag", "");
            }
        } 
    </script>
   
    
    
    <p>
        <asp:Button ID="btnOK" runat="server" onclick="btnOK_Click" Text="提交" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnCancel" runat="server" onclick="btnCancel_Click" Text="取消" />
    </p>
  
</asp:Content>